package com.itheima.controller;

import com.itheima.pojo.po.VisualizationPo;
import com.itheima.service.IVisualizationService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.itheima.utils.Result;

/**
 * 可视化Controller
 *
 * @author guanhuaer
 * @date 2025-03-20
 */
@RestController
@RequestMapping("/visualization")
public class VisualizationController {
    @Autowired
    private IVisualizationService visService;

    @GetMapping("/userDataList")
    @ApiOperation("可视化-用户数据列表")
    public Result getUserDataList(VisualizationPo po) {
        return Result.success(visService.getUserDataList(po));
    }

    @GetMapping("/userMapData")
    @ApiOperation("可视化-用户地图数据")
    public Result getUserMapDataList(VisualizationPo po) {
        return Result.success(visService.getUserMapDataList(po));
    }

    @GetMapping("/userDataStatistics")
    @ApiOperation("可视化-用户数据统计")
    public Result userDataStatistics(VisualizationPo po) {
        return Result.success(visService.userDataStatistics(po));
    }

    @GetMapping("/userLoginStatistics")
    @ApiOperation("可视化-用户登录及占比统计")
    public Result userLoginStatistics(VisualizationPo po) {
        return Result.success(visService.userLoginStatistics(po));
    }

    @GetMapping("/userActiveStatistics")
    @ApiOperation("可视化-用户活跃及占比")
    public Result userActiveStatistics(VisualizationPo po) {
        return Result.success(visService.userActiveStatistics(po));
    }
    @GetMapping("/projectStatistics")
    @ApiOperation("可视化-获取项目统计数据")
    public Result projectStatistics(VisualizationPo po) {
        return Result.success(visService.projectStatistics(po));
    }
    @GetMapping("/projectLineData")
    @ApiOperation("可视化-获取项目折线图数据")
    public Result projectLineData(VisualizationPo po) {
        return Result.success(visService.projectLineData(po));
    }
    @GetMapping("/projectMapData")
    @ApiOperation("可视化-获取项目地图数据")
    public Result projectMapData(VisualizationPo po) {
        return Result.success(visService.projectMapData(po));
    }
    @GetMapping("/getProjectTypePie")
    @ApiOperation("可视化-项目数量及占比统计")
    public Result getProjectTypePie(VisualizationPo po) {
        return Result.success(visService.getProjectTypePie(po));
    }
    @GetMapping("/getProjectTypeBar")
    @ApiOperation("可视化-项目类型数量及占比")
    public Result getProjectTypeBar(VisualizationPo po) {
        return Result.success(visService.getProjectTypeBar(po));
    }
    @GetMapping("/getProjectVisit")
    @ApiOperation("可视化-项目浏览量和访问量")
    public Result getProjectVisit(VisualizationPo po) {
        return Result.success(visService.getProjectVisit(po));
    }








}
